package model

import (
	"tushare/model/mysql"
)

type Users struct {
	Id       int64  `json:"id"`
	Name     string `json:"name"`
	Password string `json:"password"`
}

func (u Users) UserList() (list []Users) {
	mysql.DB.Find(&list)
	return list
}

/**
	根据登录名获取用户信息
**/
func (u *Users) UserInfo(name string) (user *Users) {
	mysql.DB.Where("name = ?", name).First(&u)
	return u
}
